package com.qingxin.park.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

import com.qingxin.sys.entity.Notify;

/**
 * 园区通知
 */
@Entity
@Table(name = "park_notify")
public class ParkNotify extends com.qingxin.sys.entity.BaseEntity implements
		java.io.Serializable {
	private static final long serialVersionUID = 9031061580414618853L;
	
	private String id;
	private Notify notify;
	private FarmPark farmPark;
	private String readFlag;
	private Date readTime;
	private String readBy;

	// Constructors

	/** default constructor */
	public ParkNotify() {
	}

	/** full constructor */
	public ParkNotify(Notify notify, FarmPark farmPark, String readFlag,
			Date readTime, String readBy) {
		this.notify = notify;
		this.farmPark = farmPark;
		this.readFlag = readFlag;
		this.readTime = readTime;
		this.readBy = readBy;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "notify_id")
	public Notify getNotify() {
		return this.notify;
	}

	public void setNotify(Notify notify) {
		this.notify = notify;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parkid")
	public FarmPark getFarmPark() {
		return this.farmPark;
	}

	public void setFarmPark(FarmPark farmPark) {
		this.farmPark = farmPark;
	}

	@Column(name = "read_flag", length = 1)
	public String getReadFlag() {
		return this.readFlag;
	}

	public void setReadFlag(String readFlag) {
		this.readFlag = readFlag;
	}

	@Column(name = "read_time", length = 23)
	public Date getReadTime() {
		return this.readTime;
	}

	public void setReadTime(Date readTime) {
		this.readTime = readTime;
	}

	@Column(name = "read_by", length = 32)
	public String getReadBy() {
		return this.readBy;
	}

	public void setReadBy(String readBy) {
		this.readBy = readBy;
	}

}